package pers.liyan.shi.springcloud.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pers.liyan.shi.springcloud.domain.Dept;
import pers.liyan.shi.springcloud.mapper.DeptMapper;
import pers.liyan.shi.springcloud.service.IDeptService;

import java.util.List;

@Service
public class DeptService implements IDeptService {

    @Autowired
    private DeptMapper deptMapper;

    @Override
    public Dept findByNo(Long deptNo) {
        return deptMapper.findByNo(deptNo);
    }

    @Override
    public List<Dept> findAll() {
        return deptMapper.findAll();
    }

    @Override
    public int addDept(Dept dept) {
        return deptMapper.addDept(dept);
    }

    @Override
    public int updateByNo(Dept dept) {
        return deptMapper.updateByNo(dept);
    }

    @Override
    public int deleteByNo(Long deptNo) {
        return this.deptMapper.deleteByNo(deptNo);
    }
}
